AC_PREREQ([2.68])

AC_INIT([FunkyC++], [0.1],dnl
[valentin.david@gmail.com],dnl
[funky-cxx],dnl
[http://code.google.com/p/funky-cxx/]dnl
)

AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([config])
AC_CONFIG_HEADERS([config/config.h src/funky-config.hh])

AM_INIT_AUTOMAKE([1.11 foreign
                  dist-bzip2 tar-pax
                  color-tests parallel-tests
                  -W -Wall])
AM_SILENT_RULES([yes])

AC_LANG_CPLUSPLUS
AC_PROG_CXX
if ! test "$ac_test_CXXFLAGS" = set; then
  CXXFLAGS=`echo "$CXXFLAGS" | sed "s/-O2/-O3/g"`
fi
CXX_WALL

AC_PROG_INSTALL
AC_PROG_SED

CXX0X_FLAG
CHECK_CXX03_HEADERS([bitset
		     cassert
		     functional
		     iostream
		     string])

CHECK_CXX0X_HEADERS([forward_list])

CXX0X_FUNCTION
CXX0X_LAMBDAS
CXX0X_TYPED_ENUMS
CXX0X_AUTO
CXX0X_DECLTYPE

AC_SUBST([EXTRACPPFLAGS])
AC_SUBST([AM_CPPFLAGS],
         ['-I$(top_srcdir)/src -I$(top_builddir)/src '"$EXTRACPPFLAGS"])

AC_ARG_VAR([VALGRIND], [set valgrind path for testing])

AC_CHECK_PROGS([VALGRIND], [valgrind])
AM_CONDITIONAL([HAVE_VALGRIND], [test -n "$VALGRIND"])

DISTCHECK_CONFIGURE_FLAGS=`echo "$ac_configure_args" | sed "s/'--prefix=[[^']]*'//g;s/'--[[^-]]*dir=[[^']]*'//g"`

AC_SUBST([DISTCHECK_CONFIGURE_FLAGS])


PKG_CHECK_MODULES_VERSION([AM], [jack>=0.118.0])

AC_SUBST([funkycxxdir], ["$includedir/funky-cxx"])

FUNKYCXX_DEFINE([PACKAGE
		PACKAGE_BUGREPORT
		PACKAGE_NAME
		PACKAGE_STRING
		PACKAGE_TARNAME
		PACKAGE_URL
		PACKAGE_VERSION
		VERSION])

AC_CONFIG_FILES([
	Makefile
	src/Makefile
	examples/Makefile
	funky-cxx.pc
])

AC_OUTPUT
